package com.dropdb.demo.controller.admin;

import com.dropdb.demo.bean.bo.BaseData;
import com.dropdb.demo.bean.vo.BaseRespVO;
import com.dropdb.demo.service.UserService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author:tanxin Desc:
 * @date:2020/6/26 16:30
 */
@RestController
@RequestMapping("admin/user")
public class AdminUserController {
    @Resource
    UserService userService;
    @RequestMapping("/list")
    @RequiresPermissions(value = {"*", "admin:user:list"}, logical = Logical.OR)
    public BaseRespVO list(Integer page, Integer limit, String sort, String order,String username,String mobile){
        BaseData baseData = userService.queryUsers(page, limit, sort, order,username,mobile);
        return BaseRespVO.ok(baseData);
    }
}
